<?php

/**
 * ProductCategory form.
 *
 * @package    vogue
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ProductCategoryForm extends BaseProductCategoryForm
{
  public function configure()
  {
  		 	# WIDGETS
      $this->widgetSchema['name']       = new sfWidgetFormInputText(array(), array('style'=>'width:400px; height:15px;'));
      $this->widgetSchema['description']       = new sfWidgetFormInputText(array(), array('style'=>'width:400px; height:40px;'));
	  $this->widgetSchema['parent_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ProductCategory'), 'add_empty' => true), array('style'=>'width:400px;height:24px;'));
      $this->widgetSchema['picture']       = new sfWidgetFormInputFile(array(), array());	        
     	# VALIDATORS		
    	$required = 'Утга оруулна уу.';
    
		$this->validatorSchema['picture']       = new sfValidatorFile(	
                                                  array('required' => false,
                                                      'path'       => sfConfig::get("sf_upload_dir")."/productCategory",
                                                      'max_size'   => 209715200,
                                                      'mime_types' =>  array('image/jpeg','image/pjpeg','image/png','image/x-png','image/gif',)),
                                                  array(
                                                      'max_size'   => 'Файлын хэмжээ хамгийн ихдээ 20MB байна',
                                                      'mime_types' => 'Дараах өргөтгөлтэй файлууд зөвшөөрөгдөнө: jpg, png, gif'));

      
      $this->widgetSchema->setHelp('picture', 'x px - png | gif | jpg');
      
      // LABELS      
      $this->widgetSchema->setLabel('name', 'Нэр');
      $this->widgetSchema->setLabel('description', 'Тухай');
      $this->widgetSchema->setLabel('parent_id', 'Эцэг категори');
      $this->widgetSchema->setLabel('picture', 'Зураг');
  }
}
